
package com.zmks.jkgj.xuexiao.service.impl;



import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;

import com.zmks.jkgj.core.dao.IGenericDao;
import com.zmks.jkgj.core.service.impl.GenericServiceImpl;
import com.zmks.jkgj.xuexiao.dao.view.IGrade_Class_Teacher_ViewDao;
import com.zmks.jkgj.xuexiao.pojo.CrctObjClass;
import com.zmks.jkgj.xuexiao.pojo.CrctObjSchool;
import com.zmks.jkgj.xuexiao.service.ICrctObjClassService;
import com.zmks.jkgj.xuexiao.service.ICrctObjSchoolService;
import com.zmks.jkgj.xuexiao.view.Grade_Class_Teacher_View;
import com.zmks.jkgj.xuexiao.vo.CrctObjClassVO;
import com.zmks.jkgj.xuexiao.vo.CrctObjSchoolVO;


public class CrctObjClassServiceImpl   extends GenericServiceImpl<CrctObjClass, CrctObjClassVO> implements ICrctObjClassService  {
	
	@Autowired
   IGrade_Class_Teacher_ViewDao grade_Class_Teacher_ViewDao;
	
	
	public CrctObjClassServiceImpl(IGenericDao<CrctObjClass> genericDao) {
		super(genericDao);
	}
	
	
  public 	List<Grade_Class_Teacher_View> getView(String  school_oid) {
	 
	  DetachedCriteria query = DetachedCriteria.forClass(Grade_Class_Teacher_View.class);
	  query.add(Restrictions.eq("schooloid",school_oid));
	  query.add(Restrictions.eq("positionOid","0"));
	 return  grade_Class_Teacher_ViewDao.getList(query);
	}
public IGrade_Class_Teacher_ViewDao getGrade_Class_Teacher_ViewDao() {
	return grade_Class_Teacher_ViewDao;
}
public void setGrade_Class_Teacher_ViewDao(
		IGrade_Class_Teacher_ViewDao grade_Class_Teacher_ViewDao) {
	this.grade_Class_Teacher_ViewDao = grade_Class_Teacher_ViewDao;
}


public Grade_Class_Teacher_View getView(Long class_oid) {
	  DetachedCriteria query = DetachedCriteria.forClass(Grade_Class_Teacher_View.class);
	  query.add(Restrictions.eq("id",class_oid));
	 return  grade_Class_Teacher_ViewDao.getUniqueResult(query);
}
}
